<template>
  <div>
    <router-view></router-view>
    <van-tabbar v-model="active" active-color="red" @change="onChange">
      <van-tabbar-item name="new" icon="home-o">新的订单</van-tabbar-item>
      <van-tabbar-item name="old" icon="search">历史订单</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return { active: "new" };
  },
  methods: {
    onChange(index) {
      console.log("333" + index);
      if (index === "new") {
        this.$router.push("/contract-list");
      } else if (index === "old") {
        this.$router.push("/history-list");
      }
    },
  },
};
</script>
<style lang='css' scoped>

.van-tabbar--fixed {
    position: fixed;
    top: 0;
    left: 0;
}

</style>